#include<bits/stdc++.h>
using namespace std;
int main(){
	while(1){
		int n = 0;
		cin >> n;
		if(!n){
			return 0;
		}
		string color;	
		unordered_map<string, int> count;
		for(int i=1;i<=n;i++){
			
			cin>>color;
			count[color]++;
		}
		int maxCount = 0;
		
		for(const auto& it : count){
			if(it.second >maxCount){
				maxCount = it.second;
				color = it.first;
			}
		}
		cout << color<<endl;
	}
	return 0;
}
